#ifndef __SHELL_H
#define __SHELL_H
#include <stdint.h>
#include "drv_base.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
    uint16_t argsNum;
    const char *(*getArg)(uint8_t argIdx);
    const char *(*getName)(void);
} ShellCmdArgs;
typedef void (*ShellCmdFunc)(const ShellCmdArgs *args);
typedef struct {
    const char *name;
    ShellCmdFunc func;
} ShellCmdEntry;

#define EXPORT_SHELL_CMD(_name, _func)      const ShellCmdEntry _shellCmd_##_func \
                                            ABS_USED \
                                            ABS_SECTION("shell_cmd") = { \
                                                .name = _name, \
                                                .func = _func \
                                            }

void Shell_Init(void);

#ifdef __cplusplus
}
#endif
#endif